<template>
  <div id="app">
    <el-container>
      <el-aside width="200px">
        <el-menu
          default-active="1"
          class="el-menu-vertical-demo"
          background-color="#545c64"
          text-color="#fff"
          @select="select"
          active-text-color="#ffd04b">
          <el-menu-item index="1">
            <i class="el-icon-menu"></i>
            <span slot="title">首页</span>
          </el-menu-item>
          <el-submenu index="2">
            <template slot="title">
              <i class="el-icon-share"></i>
              <span>出租车轨迹</span>
            </template>
            <el-menu-item index="2-1">单点轨迹</el-menu-item>
            <el-menu-item index="2-2">多点轨迹</el-menu-item>
          </el-submenu>
          <el-menu-item index="3">
            <i class="el-icon-location"></i>
            <span slot="title">出租车停留点</span>
          </el-menu-item>
          <el-menu-item index="4">
            <i class="el-icon-upload"></i>
            <span slot="title">压缩轨迹</span>
          </el-menu-item>
          <el-submenu index="5">
            <template slot="title">
              <i class="el-icon-view"></i>
              <span>交通热力分析</span>
            </template>
            <el-menu-item index="5-1">区域热力图分析</el-menu-item>
            <el-menu-item index="5-2">道路热力分析</el-menu-item>
          </el-submenu>
          <el-menu-item index="6">
            <i class="el-icon-location-outline"></i>
            <span slot="title">热门出行点</span>
          </el-menu-item>
          <el-menu-item index="7">
            <i class="el-icon-edit-outline"></i>
            <span slot="title">路况分析</span>
          </el-menu-item>
        </el-menu>
      </el-aside>
      <el-main>
        <router-view/>
      </el-main>
    </el-container>
  </div>
</template>

<script>

  export default {
    name: 'App',
    mounted:function(){
      this.linkTo("/index");
    },
    methods:{
      select:function (index,path) {
        switch (index){
          case "1":this.linkTo("/index");break;
          case "4": this.linkTo("/compress");break;
          case "2-1": this.linkTo("/SinglePath");break;
          case "2-2": this.linkTo("/Large");break;
          case "3": this.linkTo("/StopPoint");break;
          case "5-1": this.linkTo("/AreaHeat");break;
          case "5-2": this.linkTo("/RoadHeat");break;
          case "6": this.linkTo("/Spot");break;
          case "7": this.linkTo("/RoadCondition");break;

        }
      },
      linkTo:function (path) {
        this.$router.push({  //核心语句
          path:path   //跳转的路径
        })
      }
    }
  }
</script>

<style>
  body, html {
    margin: 0;
    padding: 0;
    height: 100%;
  }

  .el-container {
    height: 100%;
  }

  #app {
    height: 100%;
  }
  .el-menu{
    height: 100%;
  }
  #myChart{
    width: 100%;
    height: 100%;
  }
  .anchorBL{
    display: none;
  }
</style>
